﻿using IP2Region.Net.Abstractions;
using IP2Region.Net.XDB;
using Zhp.Common.Helper;

namespace Zhp.Api.Extensions
{
    public static class IpSearcherSetup
    {
        public static void AddIpSearcherSetup(this IServiceCollection services)
        {
            services.AddSingleton<ISearcher>(new Searcher(CachePolicy.Content, Path.Combine(AppHelper.WebHostEnvironment.WebRootPath, "resource", "ip", "ip2region.xdb")));
        }
    }
}
